#pragma once
#include <iostream>
#include <fstream>
#include "httpauditor.h"
#include "httpcaptor.h"
#include <ace/Thread_Manager.h>
#include "ace/Log_Msg.h"
#include "ace/Reactor.h"
#include <string.h>
#include "ffcs_logger.h"
#include "my_ringbuffbased_fifo.h"
#include "msgdefine.h"
#include "Pcre.h"
using namespace std;


class survey
{
public:
	survey(void);
	~survey(void);
	int create();
	int destroy();
	int load_config();

	int run();
	int stop();
	int add_rule(const string &name, const string &patten);
	void clear_rule();
	vector<MatchResult> run_regex(const char source[]);

private:

	static void process_usr_quit(void* args);
private:
	Logger  _log;
	httpcaptor* _captor;
	httpauditor* _auditor;
	my_berkeleyDB _db;
	my_fifo<tcp_connection_info >* _ringfifo;
	Pcre  _pcre;
	ACE_thread_t*  _captor_id;
};

